const {recycleMod} =require('../mod/recycleMod');

module.exports.addInfo=async function(Info){
    let data =await recycleMod.create(Info);
}

module.exports.selectInfo=async function({onenum,num}){
  let sumNum=await recycleMod.countDocuments();
  let sumPage=Math.ceil(sumNum/onenum);
  let data=await recycleMod.find().limit(onenum-0).skip((num-1)*onenum);
  return {
    sumPage: sumPage,
    data: data
  };
}

module.exports.deleteInfo =async function(Info){
  let data = await recycleMod.remove({_id:Info.id});

}